﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Xarmarin.GoldFinger.Engine.Core;
using Xarmarin.GoldFinger.Engine.WorldBase;
using Xarmarin.GoldFinger.Models.AutoModels;
using Xarmarin.GoldFinger.Services;
using Xarmarin.GoldFinger.ViewModels;

namespace Xarmarin.GoldFinger.Views.Subject
{
	[XamlCompilation(XamlCompilationOptions.Compile)]
	public partial class SubMainPage : ContentPage
	{
        Auto_Subject viewModel;
		public SubMainPage ()
		{
			InitializeComponent ();
            Title="修行";
            Icon = "icon16.png";
            BackgroundImage = "timg.jpg";
            viewModel= KzContext.CurrSubject;
            BindingContext = viewModel;
        }
        private async void ImageButton_Clicked(object sender, EventArgs e)
        {
            //世界法则--境界突破
            await StateBase.MoveNextSmallState();
            //反馈到数据库
            SubjectDataStore.UpdateModel(KzContext.CurrSubject);
            viewModel = KzContext.CurrSubject;
        }
    }
}